<template>
  <div class="options-box">
    <template v-for="(item,index) in moduleOptions">
      <el-button
        size="mini"
        :key="index"
        @click="(e) => {addTempItem(e,item)}"
      >{{ item.title }}</el-button>
    </template>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tablePopover: false,
    }
  },
  computed: {
    moduleOptions() {
      return this.$vptd.state.moduleOptions
    },
  },
  methods: {
    // 添加组件
    addTempItem(e, item) {
      this.$vptd.dispatch('addModuleItem', item)
    },
  },
}
</script>

<style lang="scss" scoped>
.options-box {
  .el-button {
    margin-bottom: 10px;
    margin-right: 10px;
    margin-left: 0;
  }
}
</style>
